import Component from 'utils/js/jquery-component';
import createClass from 'utils/js/create-class';
import s from './index.css';
import qrcode from 'utils/js/jquery.qrcode';
import html from './index.html';

export default createClass(Component, {
  __name__: 'Example',
  locals: s,

  __init__: function (el) {
    this.use(qrcode);
    this.$wrap = this.$(el || document.body);
    this.$html = this.$(this.rh(html));
    this.$erweima = this.$html.filter(this.rs('.erweima'));
    this.$erweima.ylmqrcode({
      text: window.location.origin + '/aichat.html' + window.location.search,
      // logo: "https://ylm.mao-app.com/img/cat.png",
      correctLevel: 2,
    });
    this.$html.appendTo(this.$wrap);
  },
});
